#include "shape.h"

shape::shape(void)
{
	this->x = 0;
	this->y = 0;
	this->id= "-";
}

shape::shape(double x, double y)
{
	this->x = x;
	this->y = y;
	this->id= "-";
}

shape::shape(std::string id, double x, double y)
{
	this->x = x;
	this->y = y;
	this->id=id;
}


shape::~shape(void)
{
	//std::cout << "Destruktor shape id=" << this->id << std::endl;
}


ostream &operator<<(ostream &stream, shape &o)
{
	stream << "(id,x,y)=(" << o.id << "," << o.x << "," << o.y << ")";
	return stream;
}

istream &operator>>(istream &stream, shape& o)
{
	char c,s[100];
	stream >> c;
	stream.getline(s,99,',');
	o.id = string(s);
	stream >> o.x >> skipws >> c >> o.y >> skipws >> c;

	return stream;
}
